Class Objects.LaraObject
Class for player-only functions.
Do not try to create an object of this type. Use the built-in Lara variable instead. LaraObject inherits all the functions of Moveable.
Functions
LaraObject:SetPoison([poison]) | Set the player's poison value. |
LaraObject:GetPoison() | Get the player's poison value. |
LaraObject:SetAir(air) | Set the player's air value. |
LaraObject:GetAir() | Get the player's air value. |
LaraObject:SetWet(wetness) | Set the player's wetness value, causing drips. |
LaraObject:GetWet() | Get the player's wetness value. |
LaraObject:SetStamina(New) | Set the player's stamina value. |
LaraObject:GetStamina() | Get the player's stamina value. |
Moveable:GetAirborne() | Get the player's airborne status (set when jumping and falling). |
Moveable:SetAirborne(airborne) | Set the player's airborne status. |
LaraObject:UndrawWeapon() | Undraw a weapon if it is drawn and throw away a flare if currently holding one. |
LaraObject:DiscardTorch() | Discard a held torch. |
LaraObject:GetHandStatus() | Get the player's hand status. |
LaraObject:GetWeaponType() | Get the player's weapon type. |
LaraObject:SetWeaponType(weaponType, activate) | Set the player's weapon type. |
LaraObject:GetAmmoType() | Get player weapon ammo type. |
LaraObject:GetAmmoCount() | Get current weapon's ammo count. |
LaraObject:GetVehicle() | Get current vehicle, if it exists. |
LaraObject:GetTarget() | Get the player's current targeted moveable (if it exists). |
LaraObject:GetInteractedMoveable() | Get the player's current interacted moveable (if it exists). |
LaraObject:IsTorchLit() | Check if a held torch is lit. |
LaraObject:Interact(mov, [animNumber], [offset], [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint], [actionID]) | Align the player with a moveable object for interaction. |
LaraObject:TestInteraction(mov, [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint]) | Test the player against a moveable object for interaction. |
Functions
- LaraObject:SetPoison([poison])
-
Set the player's poison value.
Parameters:
- poison int New poison value. default: 0, max: 128 Optional.
Usage:
Lara:SetPoison(10)
- LaraObject:GetPoison()
-
Get the player's poison value.
Returns:
-
int
Poison value.
Usage:
local poisonPotency = Lara:GetPoison()
- LaraObject:SetAir(air)
-
Set the player's air value.
Parameters:
- air int New air value. max: 1800
Usage:
Lara:SetAir(100)
- LaraObject:GetAir()
-
Get the player's air value.
Returns:
-
int
Air value.
Usage:
local currentAir = Lara:GetAir()
- LaraObject:SetWet(wetness)
-
Set the player's wetness value, causing drips.
Parameters:
- wetness int New wetness value. max: 255
Usage:
Lara:SetWet(100)
- LaraObject:GetWet()
-
Get the player's wetness value.
Returns:
-
int
Wetness value.
Usage:
local dripAmount = Lara:GetWet()
- LaraObject:SetStamina(New)
-
Set the player's stamina value.
Parameters:
- New int stamina value. max: 120
Usage:
Lara:SetStamina(120)
- LaraObject:GetStamina()
-
Get the player's stamina value.
Returns:
-
int
Stamina value.
Usage:
local sprintEnergy = Lara:GetStamina()
- Moveable:GetAirborne()
-
Get the player's airborne status (set when jumping and falling).
Returns:
-
bool
True if airborne, otherwise false.
- Moveable:SetAirborne(airborne)
-
Set the player's airborne status.
Parameters:
- airborne bool New airborne status.
- LaraObject:UndrawWeapon()
-
Undraw a weapon if it is drawn and throw away a flare if currently holding one.
Usage:
Lara:UndrawWeapon()
- LaraObject:DiscardTorch()
-
Discard a held torch.
Usage:
Lara:DiscardTorch()
- LaraObject:GetHandStatus()
-
Get the player's hand status.
Returns:
-
HandStatus
Hand status.
Usage:
local handStatus = Lara:GetHandStatus()
- LaraObject:GetWeaponType()
-
Get the player's weapon type.
Returns:
-
WeaponType
Current weapon type.
Usage:
local weaponType = Lara:GetWeaponType()
- LaraObject:SetWeaponType(weaponType, activate)
-
Set the player's weapon type.
Parameters:
- weaponType WeaponType New weapon type to set.
- activate
bool
If
true
, also draw the weapons or set torch lit. Iffalse
, keep weapons holstered or leave torch unlit.
Usage:
Lara:SetWeaponType(WeaponType.PISTOLS, false)
- LaraObject:GetAmmoType()
-
Get player weapon ammo type.
Returns:
-
AmmoType
Player weapon ammo type.
Usage:
local CurrentAmmoType = Lara:GetAmmoType()
- LaraObject:GetAmmoCount()
-
Get current weapon's ammo count.
Returns:
-
int
Current ammo count (-1 if infinite).
Usage:
local equippedWeaponAmmoLeft = Lara:GetAmmoCount()
- LaraObject:GetVehicle()
-
Get current vehicle, if it exists.
Returns:
-
Moveable
Current vehicle (nil if no vehicle present).
Usage:
local vehicle = Lara:GetVehicle()
- LaraObject:GetTarget()
-
Get the player's current targeted moveable (if it exists).
Returns:
-
Moveable
Target moveable (nil if the player is not currently targeting a moveable).
Usage:
local target = Lara:GetTarget()
- LaraObject:GetInteractedMoveable()
-
Get the player's current interacted moveable (if it exists).
Returns:
-
Moveable
Interacted moveable (nil if the player is not interacting with a moveable).
Usage:
local interactedMoveable = Lara:GetInteractedMoveable()
- LaraObject:IsTorchLit()
-
Check if a held torch is lit.
Returns:
-
bool
True if lit, otherwise false (also false if there is no torch in hand).
Usage:
local isTorchLit = Lara:IsTorchLit()
- LaraObject:Interact(mov, [animNumber], [offset], [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint], [actionID])
-
Align the player with a moveable object for interaction.
Parameters:
- mov Moveable Moveable object to align the player with.
- animNumber int The animation to play after alignment is complete. Default: 197 (BUTTON_PUSH).
- offset Vec3 Relative position offset from the moveable. Default: Vec3(0, 0, 312).
- minOffsetConstraint Vec3 Minimum relative offset constraint. Default: Vec3(-256, -512, 0).
- maxOffsetConstraint Vec3 Maximum relative offset constraint. Default: Vec3(256, 0, 512).
- minRotConstraint Rotation Minimum relative rotation constraint. Default: Rotation(-10, -40, -10).
- maxRotConstraint Rotation Maximum relative rotation constraint. Default: Rotation(10, 40, 10).
- actionID ActionID Input action ID to trigger the alignment. Default: Input.ActionID.ACTION.
Usage:
local Lara:Interact( moveable, 197, Vec3(0, 0, 312), Vec3(-256, -512, -256), Vec3(256, 0, 512), Rotation(-10, -30, -10), Rotation(10, 30, 10), TEN.Input.ActionID.ACTION)
- LaraObject:TestInteraction(mov, [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint])
-
Test the player against a moveable object for interaction.
Parameters:
- mov Moveable Moveable object to align the player with.
- minOffsetConstraint Vec3 Minimum relative offset constraint. Default: Vec3(-256, -512, 0).
- maxOffsetConstraint Vec3 Maximum relative offset constraint. Default: Vec3(256, 0, 512).
- minRotConstraint Rotation Minimum relative rotation constraint. Default: Rotation(-10, -40, -10).
- maxRotConstraint Rotation Maximum relative rotation constraint. Default: Rotation(10, 40, 10).